1. Technical Field
The present invention relates to a data processing device having flash ROM and to a method of erasing data from a flash ROM device, and relates more particularly to a control method for erasing a flash ROM by data sector.
2. Related Art
Flash ROM is commonly used in modern personal computers and printers, which are examples of data processing devices. Flash ROM is a type of electrically rewritable non-volatile memory, and in printers, for example, is commonly used to store programs (firmware) controlling the startup process and various control tasks, initialization values that are set during the startup process, and font data.
As shown in FIG. 2, flash ROM is internally segmented into multiple storage areas called “sectors.” Data is written to flash ROM devices by sector unit, and writing data involves first erasing all data in a sector before writing data to the erased sector. All sectors in a flash ROM device are not necessarily the same size, and flash ROM is typically divided into sectors of various sizes determined by the capacity and type of flash ROM.
Methods of determining the sector structure of a flash ROM device include using an electric signature to confirm the manufacturer and model, and directly accessing the flash memory to confirm the sector structure. See for example, Japanese Patent Application 2004-94342. Verifying the sector structure using such methods enables always knowing the actual sector structure when accessing a flash ROM device, and thus prevents accidentally erasing or reading the wrong data.
The data processing device must know the sector structure of the flash ROM device, including the size and location of each sector in the flash ROM device, in order to erase data. As a result, the firmware provided in a data processing device must be designed with an awareness of the sector structure of the flash ROM used in the data processing device.
As shown in FIG. 2, for example, the first 64 KB in 8-Mbit flash ROM device 110 and 16-Mbit flash ROM device 120 is sequentially divided into four sectors of 16 KB, 8 KB, 8 KB, and 32 KB. Erasing the first 8 Mbit of data can therefore be completed by erasing and verifying each of the four sectors in a total of four erase/verify operations. The first 64 KB in a 32-Mbit flash ROM device 130, however, is divided into eight 8-KB sectors, thus requiring eight erase/verify operations. The developer must therefore always be aware of the sector structure and implement an erasing method that matches the sector structure.